#!/usr/bin/env python3
#created by anchengan in 20250314
import utils.socket as socket

 

def is_valid_ipv4(ip):

    try:

        socket.inet_pton(socket.AF_INET, ip)

    except socket.error:

        return False

    return True

def is_valid_port(port):

    if isinstance(port, int) and 0 <= port <= 65530:

        return True

    return False

 
